{% extends "base_operlist_show.html" %}
{%block title%}
Operasyon Listesi - Ajax Refresh 
{%endblock%}
{%block content%}



<div id="sonuc">

</div>
<div id="sonucx" style="position: fixed; z-index:-1; height: 0px; width:0px; visibility: hidden;">
</div>
{%endblock%}
{%block script%}
<script language="Javascript">
function AJAX() {
   var ajax = false;
   // Internet Explorer (5.0+)
   try {
    ajax = new ActiveXObject("Msxml2.XMLHTTP");  // yeni versiyon xmlhttp
   } catch (e) {
       try {
        ajax = new ActiveXObject("Microsoft.XMLHTTP");  // eski versiyon xmlhttp
      } catch (e) {
        ajax = false;
      }
    }
   // Mozilla ve Safari
   if ( !ajax && typeof XMLHttpRequest != 'undefined' ) {
     try{
        ajax = new XMLHttpRequest();
     }catch(e) {   
        ajax = false;
     }
    }
    // Diger
   if ( !ajax && window.createRequest ) {
          try{
        ajax = window.createRequest();
     }catch(e) { 
        ajax = false;
     }
    }
     return ajax;
}

 
var deneme=0;
function removeSpaces(string) {
	 return string.split(' ').join('');
	}
 
function sorgula() {
ajax = new AJAX();

var element = document.getElementById("sonuc");
var hidden_element= document.getElementById("sonucx");
//element.innerHTML=random_num;

ajax.open("GET", "/operlist/show-h/", true);
ajax.onreadystatechange = function() {
/* if (ajax.readyState < 4 )
{ 
  element.innerHTML = "Lutfen Bekleyiniz ...";
} 
*/
if (ajax.readyState == 4 && ajax.status == 200) {
	hidden_element.innerHTML = ajax.responseText;
	
	if (element.innerHTML!=hidden_element.innerHTML)
	{	
		//hidden_element.innerHTML = ajax.responseText;
		//document.myform.outputtext.value = removeSpaces(element.innerHTML);
		//document.myform.inputtext.value = removeSpaces(hidden_element.innerHTML);
		
		element.innerHTML = ajax.responseText;
	}

	
}
    }
    ajax.send(null);
	
}


</script>
<link rel="stylesheet" type="text/css" href="/media/css/forms.css" />
<link rel="stylesheet" type="text/css" href="/media/css/table-blue.css" />
<style type="text/css">
html {
        overflow: auto;
}
</style>

{%endblock%}